import 'package:flutter/material.dart';
import 'package:flutter_food_ordering_web/res/colors.dart';
import 'package:flutter_food_ordering_web/res/dimens.dart';
import 'package:flutter_food_ordering_web/widget/load_image.dart';

class CheckoutPageNavigationBar extends StatefulWidget {

  @override
  _CheckoutPageNavigationBarState createState() => _CheckoutPageNavigationBarState();
}

class _CheckoutPageNavigationBarState extends State<CheckoutPageNavigationBar> {

  TextEditingController _searchController = TextEditingController();
  // final FocusNode _nodeText = FocusNode();

  @override
  void dispose() {
    //销毁TextField监听
    _searchController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.bottomCenter,
      height: 70,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Row(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              SizedBox(width: 120,),
              LoadAssetImage('logo',
                width: 109,
                height: 28,
              ),
            ],
          ),
          Row(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              LoadAssetImage('checkout/ic_dining_car',
                width: 46.5,
                height: 30.5,
              ),
              SizedBox(width: 10),
              Text('餐车',
                style: TextStyle(
                  fontSize: Dimens.font_sp18,
                  color: Color(0xff555555)
                ),
              ),
              SizedBox(width: 120)
            ],
          )
        ],
      ),
    );
  }

  Widget _buildCartButton() {
    return InkWell(
      onTap: (){
        debugPrint('进入购物车');
      },
      child: Container(
        width: 130,
        height: 31,
        decoration: BoxDecoration(
          color: Color(0xFFEFEFEF),
          border: Border.all(
            color: Color(0xFFA4D63A),
            width: 0.5
          )
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Row(
              children: <Widget>[
                SizedBox(width: 12),
                LoadAssetImage('store/logo_store',
                  width: 29,
                  height: 19,
                ),
                SizedBox(width: 5),
                Text('我的餐车',
                  style: TextStyle(fontSize: 11, color: Colours.text_dark),
                )
              ]
            ),
            Row(
              children: <Widget>[
                LoadAssetImage('store/store_right_arrow',
                  width: 6,
                  height: 6,
                ),
                SizedBox(width: 13)
              ],
            )
          ]
        ),
      ),
    );
  }
}